package com.group3.group3.baobiao.gdpinfo.control;

import com.group3.group3.baobiao.gdpinfo.entity.GdpinfoSearchEnity;
import com.group3.group3.baobiao.gdpinfo.service.GdpinfoService;
import com.group3.group3.mybatis.entity.GdpEntity;
import com.group3.group3.mybatis.flexigrid.PadingRstType;
import com.group3.group3.mybatis.flexigrid.PagingBean;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author Hhw-byte
 * @create 2022-05-16 11:08
 */
@Controller
@RequestMapping("/gdpinfo")
public class GdpinfoController {
    private Logger logger = LogManager.getLogger(this.getClass().getName());
    @Resource
    private GdpinfoService gdpService;

    @Secured("ROLE_gqgy_data_gdp")
    @RequestMapping("/page")
    public String gdppage() {
        return "gdpinfo/gdppage";
    }

    @RequestMapping("/getGdpinfoListByPage")
    @ResponseBody
    public PadingRstType<GdpEntity> getGdpinfoListByPage(GdpinfoSearchEnity search, PagingBean paging) {
        logger.info(search);
        PadingRstType<GdpEntity> GdpEntityPadingRstType = gdpService.getGdpinfoListByPage(search, paging);
        return GdpEntityPadingRstType;
    }
}